public class Calculator {

    private static int result = 0;

    public void add(int n) {
        result += n;
    }

    public void subtract(int n) {
        result -= n;
    }

    public void  multiply(int n) {
        result *= n;
    }

    public void divide(int n) {
        result /= n;
    }

    public void pow(int n) {
        result = (int) Math.pow(result, n);
    }

    public int getResult() {
        return result;
    }

    public void clear() {
        result = 0;
    }

}
